


Namespace My
    Public Class Business
        Public Shared Function AddNums(ByVal X As Integer, ByVal Y As Integer) As Integer
            Return X + Y
        End Function

        Public Shared Function NewCustomer(ByVal name As String) As String
            Return name & Now.Ticks
        End Function
    End Class
    Partial Friend Class MyComputer
        Public Shared Sub ShutDownForever()
            'Taét maùy
        End Sub
    End Class

End Namespace

Module OperatorDemo
    Sub Main()

        Dim A As New Fraction(1, 3)
        Dim B As New Fraction(7, 4)
        Dim C As Fraction = A + B
        Console.WriteLine("C={0}/{1}", C.Numerator, C.Denominator)
        Console.ReadLine()
    End Sub

End Module


Public Class Fraction
    Public Numerator As Integer    'Tu so
    Public Denominator As Integer  'Mau so

    Sub New()
    End Sub
    Sub New(ByVal Num As Integer, ByVal Denom As Integer)
        Me.Numerator = Num
        Me.Denominator = Denom
    End Sub
    Public Shared Operator +(ByVal X As Fraction, ByVal Y As Fraction) As Fraction
        Dim result As New Fraction
        result.Denominator = X.Denominator * Y.Denominator
        result.Numerator = X.Numerator * Y.Denominator + Y.Numerator * X.Denominator
        Return result
    End Operator
    Public Shared Operator *(ByVal X As Fraction, ByVal Y As Fraction) As Fraction
        Dim result As New Fraction
        result.Denominator = X.Denominator * Y.Denominator
        result.Numerator = X.Numerator * Y.Numerator
        Return result
    End Operator
End Class